package cn.edu.bit.dm;

import java.util.Scanner;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;




public class Main {	
	
	public static ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml"); 

	public static void main(String[] args){
		WebD webD = (WebD)ctx.getBean("webD");
		webD.start();
		while(true){
			Scanner scanner = new Scanner(System.in);
			String signal = scanner.nextLine();
			if(signal.equals("STOP")) break;			
		}		
		webD.setWork(false);
		try {
			webD.join();
		} catch (InterruptedException e) {
			//do nothing
		}
		
	}
	
	
}
